<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=100%,initial-scale=1" />
<link rel="stylesheet"  href="css/login.css" type="text/css" />
<script type="text/javascript">
function $$(id) {
    return document.getElementById(id);
}
//页面加载时调用的函数
function pageload() {
    var strName = localStorage.getItem("keyName");
    var strPass = localStorage.getItem("keyPass");
    if (strName) {
        $$("txtName").value = strName;
    }
    if (strPass) {
        $$("txtPass").value = strPass;
    }
}
//点击“登录”按钮后调用的函数
function btnLogin_click() {
    var strName = $$("txtName").value
    var strPass = $$("txtPass").value;
    localStorage.setItem("keyName", strName);
    if ($$("chkSave").checked) {
        localStorage.setItem("keyPass", strPass);
    } else {
        localStorage.removeItem("keyPass");
    }
    $$("spnStatus").className = "status";
    $$("spnStatus").innerHTML = "登录成功！";
}
</script>
<title>欢迎登陆</title>
</head>

<body>
<div>
<div class="login-form">
<div class="img"><img  src="images/timg.jpg" width="100" height="100" /></div>

<div><input id="txtName"  type="text" placeholder="请输入账号" /></div>

<div class="a"><input id="txtPass"  type="password" placeholder="请输入密码" /></div>
<div class="b">
<input id="txtSms" type="password" placeholder="请输入验证码" />
</div>
<div> <input  type="checkbox" id="chkSave">
               我确定保存密码！</div>
               
<div class="c"><input id="loginBtn" type="button" value="登陆" onclick="btnLogin_click()"/>

<input id="loginBtn" type="button" value="注册" /></div>


<div class="d">使用其他方式登录<br />
<img src="images/126-tencent-QQ.png" />
<img src="images/121-tencent-wechat.png" /><img src="images/facebook.png" /></div>

<div id="spnStatus"></div>
</div>

</body>
</html>
